CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
include(FindPkgConfig)
project(passportDirectionRegApp)

# RK3568 need standard 17
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# SET TRUE IF NEED TO BUILD EXAMPLE OR FALSE
set(EXAMPLE_REQUIRED FALSE)

set(LIB_VERSION 1.0.0)
set(LIB_SOVERSION 1)

INCLUDE(cmake/load_jsoncpp.cmake)
INCLUDE(cmake/load_opencv.cmake)
INCLUDE(cmake/load_maxvision.cmake)
INCLUDE(cmake/load_rkmedia.cmake)
INCLUDE(cmake/load_hv.cmake)
INCLUDE(cmake/load_curl.cmake)
#INCLUDE(cmake/load_nanomsg.cmake)

LOAD_LIBJSON_CPP(YOUR_TARGET_OS YOUR_TARGET_ARCH)
LOAD_PASSPORT_ALGO(YOUR_TARGET_OS YOUR_TARGET_ARCH)
LOAD_OPENCV(YOUR_TARGET_OS YOUR_TARGET_ARCH)
LOAD_RKMEIDA(YOUR_TARGET_OS YOUR_TARGET_ARCH)
LOAD_LIBHV(YOUR_TARGET_OS YOUR_TARGET_ARCH)
LOAD_CURL(YOUR_TARGET_OS YOUR_TARGET_ARCH)
#LOAD_LIBNANOMSG(YOUR_TARGET_OS YOUR_TARGET_ARCH)

include_directories(${JSON_CPP_INCLUDE_DIR})
include_directories(${MV_PASS_INCLUDE_DIR})
include_directories(${OPENCV_INCLUDE_DIR})
include_directories(${HV_INCLUDE_DIR})
include_directories(${CURL_INCLUDE_DIR})
#include_directories(${NANOMSG_INCLUDE_DIR})

link_directories(${JSON_CPP_LIBRARY_DIR})
link_directories(${MV_PASS_LIBRARY_DIR})
link_directories(${OPENCV_LIBRARY_DIR})
link_directories(${CURL_LIBRARY_DIR})
link_directories(${HV_LIBRARY_DIR})
#link_directories(${NANOMSG_LIBRARY_DIR})

option(ENABLE_VENC  "venc" ON)
if (${ENABLE_VENC})
    add_compile_definitions(ENABLE_VENC_AND_SHM)
endif()

add_subdirectory(src)

if(EXAMPLE_REQUIRED)
    add_subdirectory(example)
endif()

set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/target)